package ns3.animator.app.view.comp;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.GridLayout;

import javax.swing.BorderFactory;
import javax.swing.JPanel;

import com.jgoodies.forms.builder.DefaultFormBuilder;
import com.jgoodies.forms.layout.FormLayout;

import ns3.animator.app.globle.NsGVar;

public class LeftConfigurationPanel  extends JPanel{
	
	GridLayout content;
	ListBaseComponent dataRate,serverStopTime, selectDelay, clientStartTime, selectBaseIP, selectClientStop,selectNetworkMask, selectMaxPackets, selectInterval, selectPacketSize,selectServerStartTime;
	
	
	
	
	public LeftConfigurationPanel(){
		
		super(new BorderLayout());
			
	}
	
	
	
	
	public void build_initial(){
		setPreferredSize(new Dimension(600, this.getParent().getHeight()));
		
		dataRate = new ListBaseComponent(NsGVar.DATARATE);
		serverStopTime = new ListBaseComponent(NsGVar.SERVERSTOPTIME);
		selectDelay = new ListBaseComponent(NsGVar.SELECTDELAY);
		clientStartTime = new ListBaseComponent(NsGVar.CLIENTSTARTTIME);
		selectBaseIP = new ListBaseComponent(NsGVar.SELECTBASEIP);
		selectClientStop = new ListBaseComponent(NsGVar.SELECTCLIENTSTOP);
		selectNetworkMask = new ListBaseComponent(NsGVar.SELECTNETWORKMASK);
		selectMaxPackets = new ListBaseComponent(NsGVar.SELECTMAXPAKETS);
		selectInterval = new ListBaseComponent(NsGVar.SELECTINTERVAL);
		selectPacketSize = new ListBaseComponent(NsGVar.SELECTPACKETSIZE);
		selectServerStartTime = new ListBaseComponent(NsGVar.SELECTSERVERSTARTTIME);
		
			DefaultFormBuilder builder = new DefaultFormBuilder(new FormLayout(""));
		
			builder.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
		
		  	builder.appendColumn("right:pref");
	        builder.appendColumn("3dlu");
	        builder.appendColumn("fill:max(pref; 100px)");
	        builder.appendColumn("5dlu");
	        builder.appendColumn("right:pref");
	        builder.appendColumn("3dlu");
	        builder.appendColumn("fill:max(pref; 100px)");
		
	        
	        builder.append(NsGVar.DATARATE,dataRate.getListItems());
	        builder.append(NsGVar.SERVERSTOPTIME,serverStopTime.getListItems());
	        builder.nextLine();
	        builder.append(NsGVar.SELECTDELAY,selectDelay.getListItems());
	        builder.append(NsGVar.CLIENTSTARTTIME,clientStartTime.getListItems());
	        builder.nextLine();
	        builder.append(NsGVar.SELECTBASEIP,selectBaseIP.getListItems());
	        builder.append(NsGVar.SELECTCLIENTSTOP,selectClientStop.getListItems());
	        builder.nextLine();
	        builder.append(NsGVar.SELECTNETWORKMASK,selectNetworkMask.getListItems());
	        builder.nextLine();
	        builder.append(NsGVar.SELECTMAXPAKETS,selectMaxPackets.getListItems());
	        builder.nextLine();
	        builder.append(NsGVar.SELECTINTERVAL,selectInterval.getListItems());
	        builder.nextLine();
	        builder.append(NsGVar.SELECTPACKETSIZE,selectPacketSize.getListItems());
	        builder.nextLine();
	        builder.append(NsGVar.SELECTSERVERSTARTTIME,selectServerStartTime.getListItems());
	        builder.nextLine();
	        
	        this.add(builder.getPanel());
		
		
		
		
		
		
	}
	
	

	
	

}
